package com.kai.awt.layoutmanager;

import javax.swing.*;
import java.awt.*;

/**
 * @Author Mr.Yan
 * @create 2022/3/20 14:18
 * @description:
 */
public class Demo7 {
    public static void main(String[] args) {
        Frame frame = new Frame("box");
        Box horizontalBox = Box.createHorizontalBox();
        horizontalBox.add(new JButton("水平一"));
        horizontalBox.add(new JButton("水平二"));
        Box verticalBox = Box.createVerticalBox();
        verticalBox.add(new JButton("垂直一"));
        verticalBox.add(new JButton("垂直二"));

        frame.add(horizontalBox,BorderLayout.NORTH);
        frame.add(verticalBox);

        frame.pack();
        frame.setVisible(true);

    }
}
